home *** CD-ROM | disk | FTP | other *** search
- ---------------------------------------------------------------------------
-
- Gemterm V1.2
-
-
- Freeware from Martin Gergeleit (1992)
-
- ---------------------------------------------------------------------------
-
- Intro
-
- This is Gemterm, a xterm-clone for GEM plus MiNT. If you know MiNT, you
- probably know BG.ACC or TOSWIN. Gemterm does the similar things, but it is
- optimized for the use together with the Gemini desktop replacement. This
- means:
-
- - Gemterm provides virtual vt52 windows with concurrent TOS programs running
- inside. The number of windows is only limited by memory and/or the TOS
- version since V1.2.
-
- - Gemterm is an Accessory, that should run concurrently with any "clean" GEM
- program. It also runs as PRG since V1.2.
-
- - Gemterm supports the Gemini VA-protocol, so that dragging of objects into
- Gemterm-windows results in inserting the objects name as text, as known from
- the Gemini-console.
-
- - Gemterm uses GDOS fonts.
-
- - Gemterm provides a scroll-back buffer and allows for cut-and-paste of text
- between Gemterm-windows.
-
- - Gemterm-windows may be defined to be persistent. This means a window will
- resist a change of the main GEM PRG without the need to reopen it by hand.
-
- - Gemterm can save its status into a configuration file and will reboot to
- the saved configuration. It will also start up again the TOS programs inside
- its windows. Gemterm also supoorts the TOSRUN pipe. The small programm
- "gxterm.ttp" (included in the Gemterm distribution) allows the startup of a
- new window from within a TOS program.
-
- - Gemterm also serves as a (very) basic terminal program.
-
- - Gemterm claims to be "clean" itself.
-
- - Gemterm comes with sources and it is free.
-
- BUT:
-
- GEMTERM COMES WITH ABSOLUTELY NO WARRANTY, NOR WILL I BE LIABLE FOR ANY
- DAMAGES INCURRED FROM THE USE OF IT. USE ENTIRELY AT YOUR OWN RISK!!!
-
- Gemterm has not been tested very much so far. I used it myself during the
- development and I tested it with some GEM PRGs. It runs on my machine, a
- 260ST (yes, they still exist even in the age of the falcon) + 2.5 MB, a
- monochrome SM124 (I is reported to run also on a color screen), TOS 1.04,
- MiNT 0.95, and Gemini 1.21. Gemterm should run on any ST on any TOS,
- but I have not tested it on any machine other than mine.
- I will try to do any sensible bugfix, but I will not support any fancy speed up
- extensions (Hard- or Software) nor any other ST models or TOS version, as I
- have no access to any TT, STE or Falcon.
-
- On the other hand: Gemterm comes with the complete sources (even if comments
- are rare and the code is not very pretty). It is compiled with gcc 1.40 and
- mintlib Patchlevel 20, so if you suggest any enhancements: Try it!
-
- ---------------------------------------------------------------------------
-
- What is new since V1.0
-
- - Gemterm now checks wether GDOS is loaded or not. V1.0 crashed if there was no
- GDOS.
- - The font selector now knows about the number of fonts installed. This should
- correct a bug that disabled font selection in some cases.
-
- What is new since V1.1
-
- - Gemterm now runs also as application.
- - Gemterm now supports the TOSRUN pipe.
- - The current working directory is now also a parameter for a program that
- should be launched in a window.
- - Gemterm now knows about the environment variables "GEMTERMINF", "GEMTERMTTY",
- "GEMTERMAPPL" and "GEMTERMWINS". "GEMTERMINF" sets the path and the filename
- of the configuration file. "GEMTERMTTY" selects the device that is
- connected to the tty window. "GEMTERMAPPL" denotes the main application that
- Gemterm wants to talk to via the VA protocol and "GEMTERMWINS" adjusts the
- maximum number of term window during startup.
- - Gemterm reads the environment variables "SHELL" and "HOME" for its default
- configuration.
- - Bug-reports should be much easier, if you recompile Gemterm with the -DDEBUG
- option in case of crashes. With this option Gemterm traces all its actions to
- stderr.
- - A bug that hang GEM, when activating window-arrows with a very high
- frequentcy should be fixed. (No more additional WM_REDRAW message from
- Gemterm to itself, but instant redrawing.)
-
-
- ---------------------------------------------------------------------------
-
- How to install Gemterm
-
- Simply copy GEMTERM.ACC into the root directory of you boot-partition (floppy?)
- and make sure that MiNT is installed as well. Reboot the machine. The entry
- "Gemterm" should appear in the GEM menu bar. If you want to use Gemterm as
- an application (PRG) simply start it.
-
-
- How to use Gemterm
-
- Gemterm is activated via a click into its menu item, via activating its icon
- from the Gemini desktop or via dragging an object onto its Gemini icon. If
- there exists any closed, but still living Gemterm window it will be reopend.
- In any other case Gemterm answers with a dialog-box. Now you may define a new
- window. There is no chance of redefining the look of a window once it has been
- created. This should be changed! (If you start Gemterm as PRG you may also
- select the menu item "OPEN" to get here). You may configure the following items:
-
- - The type of the new window: PROG, PTY, or TTY
-
- PROG means you want to run a TOS program inside the window. That's the
- normal case (and because of this the default).
-
- PTY means a virtual vt52 terminal connected to a MiNT pty is created
- with no process inside. You may use it as an output device for a GEM
- program for example.
-
- TTY means a virtual vt52 terminal connected to "/dev/tty" is created
- with no process inside. You may use it as a simple terminal program with
- the benefit of cut-and-paste with the local Gemterm-windows. Flow control
- seems not to work correctly! The baud rate and all the other RS232
- parameters have to be set by some other tools, you may probably already
- have. This feature will be extended in the next version of Gemterm (maybe
- with the uw-protocol). If the environment variable "GEMTERMTTY" is defined
- Gemterm will open this device instead of "/dev/tty". So you may connect the
- terminal window to any port you like. (e.g. GEMTERMTTY = "u:/dev/midi"). If
- the value of "GEMTERMTTY" does not denote an existing device, e.g.
- GEMTERMTTY = "NONE", the TTY feature will be disabled. (This saves one
- file-descriptor for the main application)
-
- - The name of the TOS program
-
- A click on the name string will make a file-selector box being opend in
- order to select the TOS or TTP program that will be started inside the
- new window. The default is "U:\bin\sh.ttp" or, if defined, the value of the
- environment variable "SHELL".
-
- - The arguments of the program
-
- Enter any arguments for a TTP program here. They will be passed to the
- program using the standard atari format (no XARG, but the length of the
- string is very limited anyway!).
-
- - The current working directory of the program
-
- A click on the current working directory string will make a file-selector
- box being opend in order to select the directory the program will be started
- in. Default is "U:\" or, if defined, the value of the environment variable
- "HOME".
-
- - The face and the size of the font for the new window
-
- Select the desired font using the "+" and "-" buttons. A sample of the
- selected font will be displayed.
-
- - The lines and columns of the new window
-
- Enter the desired size of the window in terms of characters. There are some
- (sensible ?) lower bounds, but the maximum size is only limited by the
- (staticly) allocated memory for gemterm. Nevertheless a size of 80x25 seems
- to be a VERY sensible default as most of the TOS applications never even
- think of anything else. But if your program understands to use the TERM
- environment variable and the "/etc/termcap" file you may be able to use
- any size you like. Gemterm itself does not touch the TERM environment
- variable. It also does not know about a TERMCAP variable.
-
- - The length of the history (scroll-back) buffer
-
- Enter the size in terms of KB. The scroll-back buffer contains all the
- lines that scrolled out of the top of the virtual screen. It is a FIFO
- that stores the lines as close as possible. This means e.g. a line
- of four characters only occupies five bytes in the buffer, an empty line
- only one byte. So 4 KB (the default) may be a sensible compromise between
- memory usage and history length. If there is not enough memory left,
- Gemterm will quitely cancel the scroll-back buffer.
-
- - The persistent attribute
-
- For each Gemterm window you may define if it is persistent or not. If it is,
- Gemterm tries to reopen it after it has been closed because of a change
- of the main GEM application (started a new one or left an old one). This may
- cause some problems with GEM applications that are very slow in their
- initialization phase. So disable the persistent attribute, if it makes
- trouble.
-
- - The exit-close attribute
-
- For each Gemterm window you may define if should be closed, if the process
- inside exited. (This makes only sense for windows of the PROG type.)
- Otherwise the message "<EXIT>" will be printed by Gemterm into a window
- whose process died.
-
- - The "\ -> /" attribute
-
- This attribute specifies if a backslash-to-slash conversion should be done
- during cut-and-paste and Gemini object name insertion. This may be useful
- if the program inside the window expects UX-like pathnames.
-
- - The OK-Button creates the defined window.
-
- - The SAVE-Button
-
- The current configuration (without the PTY-type windows) will be written
- into the file "U:/etc/gemterm.inf" or, if it is defined, in a file whose name
- is given in the environment variable "GEMTERMINF". Any existing contents
- of this file will be lost. Gemterm reads this file at its first activation
- and tries to restore this configuration (including the started processes
- inside the windows (but not their children!)). The same will happen if you
- select the item "SAVE" from the menu of Gemterm as PRG.
-
- Once a Gemterm window is created you may do with it whatever you are used to
- do with any GEM window. If you close it via the close box, it will still
- exist. If you activate Gemterm again, it will be reopend (if possible). If
- you want to destroy an existing Gemterm window press the "Control" key while
- clicking on the close box. This will send a "SIGHUP" to the process inside
- the window. If you press the "Alt" key instead you will send "SIGKILL". In any
- case the window will be destroyed. It can be reused by a new process.
-
- Cut-and-paste is done with the mouse buttons. Press the left button to get a
- rubberbox to select the text to be cut. Press the right button to insert this
- text. The process inside the window will see the input from normal
- "stdin". The cut-and-paste buffer is limited to 512 bytes but this may be
- changed by recompiling with a larger constant.
-
- Gemterm now also knows about the environment variables "GEMTERMAPPL" and
- "GEMTERMWINS". "GEMTERMAPPL" denotes the main application that
- Gemterm wants to talk to via the VA protocol (Gemini is the default).
- "GEMTERMWINS" adjusts the maximum number of term window. This has to be
- configured during startup. There is a trade off between usable windows (ptys)
- and reserved file-descriptors (see also below for the implementation details).
-
- A typical setup for Gemterm in the MINT.CNF may look like:
-
- setenv GEMTERMINF U:\USER\MFG\GEMTERM.INF
- setenv GEMTERMTTY NONE
- setenv GEMTERMAPPL GEMINI
- setenv GEMTERMWINS 2
-
- The TOSRUN pipe has been invented by Eric Smith and his TOSRUN program. Gemterm
- now also supports the TOSRUN pipe. It tries to create a pipe called "U:/pipe/
- tosrun" and it listens to it. A null-terminated string of the form:
- "<working dir> <program name> <arguments>" written to this pipe will now make
- Gemterm to open a new window with this program started inside. The working dir
- and the program name must be given in absolut path-names (including the
- extension ".ttp" or ".tos"). The arguments are optional. All the values given
- via the TOSRUN pipe are treaded like changing the corresponding items in the
- selector box. This means a comand via the pipe will change the settings of this
- box.
-
- Gemterm understands an extension of the TOSRUN protocol. If the first char in
- a command is 0x01, the second char will be interpreted as a flag set. These
- flags have the following meaning:
-
- 0x01 Open the selector box before starting the program inside the new window. By
- default the selector box is not displayed.
-
- 0x02 Open the new window with the "EXIT_CLOSE" attribute disabled.
-
- 0x04 Open the new window with the "EXIT_CLOSE" attribute enabled.
- If neither 0x02 noe 0x04 are set the current default will be used.
-
- I can think of a lot of additional settings that should be sensible, but they
- are not (yet) implemented.
-
- The small programm "gxterm.ttp" (included in the Gemterm distribution) allows
- the easy startup of a new window from within a TOS program. The syntax is:
-
- gxterm {-c -k -n} <working dir> <program name> {arguments}
-
- The flags c,k, and n correspond to the flags 0x01, 0x02, and 0x04 and all the
- other parameters are simply written into the TOSRUN pipe. Now with the call
-
- gxterm -n U:\user\mfg\gemterm U:\usr\local\bin\uemacs.ttp gemterm.c
-
- a shell script, for example, can open a new editor window that closes when the
- editor terminates.
-
- ---------------------------------------------------------------------------
-
-
- Recompiling Gemterm
-
- Gemterm has been compiled with gcc 1.40, but it should compile with any gcc.
- Other compilers have not been tested. Gemterm needs a mintlib (currently PL 20)
- and some of the headers from the MiNT distribution, namely mintbind.h, signal.h,
- and filesys.h. The gemlib from the gcc distribution is also needed.
-
- Mint comes with a makefile but recompilation "by hand" is also straight
- forward. There are no special options needed (NO -mshort: ints are 32 bit).
-
- ---------------------------------------------------------------------------
-
- Some implementation issues
-
- Gemterm uses a number of features of MiNT (thank you Eric!). The most
- important extensions used in Gemterm are the multitasking feature and the ptys.
-
- Gemterm itself is an ordinary GEM Accessory. It has no additional MiNT process
- inside, so its process changes as the GEM main PRG changes. All its resources
- are allocated statically (namley the memory and the file-handles). Gemterm
- allocates 32 KB of workspace and it uses 4 file-handles for its windows and
- 1 for the "/dev/tty" device. This means there are only 27 handles left
- for the application (this may be a restriction).
-
- Gemterm maintains a MiNT pty (or the tty-device) for every window. It starts
- the TOS processes with redirected in and out streams and feeds keystrokes into
- the pty of the active window. It also polls all windows for output and
- displays it inside the window.
-
- Persistent windows are implemented by setting a time-out as reaction to a
- AC_CLOSE event. When this time-out expires Gemterm send itself a reopen-
- message. (This seems to be compatible to most of the GEM PRGs).
-
- ---------------------------------------------------------------------------
-
- Compatibility
-
- - Gemterm is reported to work on a TT in 16 colors (Gemterm uses only 2).
-
- - Gemterm has been running with all kinds of Gdos's (GDOS 1.1, AMCLIGHT,
- FontGDOS, and FSMGDOS).
-
- - Problems have been reported with NVDI (at least older versions).
-
- ---------------------------------------------------------------------------
-
- Thanks to Scott Kolodzieski for his bug-fixes.
-
- ---------------------------------------------------------------------------
-
- If you have any ideas, bugreports, ... , drop a mail to:
-
- <mfg@gmdzi.gmd.de>
-
- Martin Gergeleit
- Am Klostergarten 4a
- 5300 Bonn 1
- Germany
-